package com.sogou.qadev.service.login.client.data;

public class DataProxy implements com.sogou.qadev.service.login.client.data.Data {
  private String _endpoint = null;
  private com.sogou.qadev.service.login.client.data.Data data = null;
  
  public DataProxy() {
    _initDataProxy();
  }
  
  private void _initDataProxy() {
    try {
      data = (new com.sogou.qadev.service.login.client.data.DataServiceLocator()).getData();
      if (data != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)data)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)data)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (data != null)
      ((javax.xml.rpc.Stub)data)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public com.sogou.qadev.service.login.client.data.Data getData() {
    if (data == null)
      _initDataProxy();
    return data;
  }
  
  public long addData(long keyId, long productId, java.lang.String dataName) throws java.rmi.RemoteException{
    if (data == null)
      _initDataProxy();
    return data.addData(keyId, productId, dataName);
  }
  
  public boolean removeData(long keyId, long dataId) throws java.rmi.RemoteException{
    if (data == null)
      _initDataProxy();
    return data.removeData(keyId, dataId);
  }
  
  public long addDataUser(long keyId, long dataId, java.lang.String username, int popedom) throws java.rmi.RemoteException{
    if (data == null)
      _initDataProxy();
    return data.addDataUser(keyId, dataId, username, popedom);
  }
  
  public boolean removeDataUser(long keyId, long dataId, long userId, int popedom) throws java.rmi.RemoteException{
    if (data == null)
      _initDataProxy();
    return data.removeDataUser(keyId, dataId, userId, popedom);
  }
  
  public long addDataGroup(long keyId, long dataId, java.lang.String groupName, int popedom) throws java.rmi.RemoteException{
    if (data == null)
      _initDataProxy();
    return data.addDataGroup(keyId, dataId, groupName, popedom);
  }
  
  public boolean removeDataGroup(long keyId, long dataId, long groupId, int popedom) throws java.rmi.RemoteException{
    if (data == null)
      _initDataProxy();
    return data.removeDataGroup(keyId, dataId, groupId, popedom);
  }
  
  public boolean renameData(long keyId, long dataId, java.lang.String newDataName) throws java.rmi.RemoteException{
    if (data == null)
      _initDataProxy();
    return data.renameData(keyId, dataId, newDataName);
  }
  
  public com.sogou.qadev.service.login.bean.Data queryData(long keyId, long dataId) throws java.rmi.RemoteException{
    if (data == null)
      _initDataProxy();
    return data.queryData(keyId, dataId);
  }
  
  public com.sogou.qadev.service.login.bean.Data[] queryDatas(long keyId, long productId, long userOrGroupId, int lines, int pageNumber, boolean isUserId) throws java.rmi.RemoteException{
    if (data == null)
      _initDataProxy();
    return data.queryDatas(keyId, productId, userOrGroupId, lines, pageNumber, isUserId);
  }
  
  public com.sogou.qadev.service.login.bean.Data[] queryUserDatas(long keyId, long productId, long userId, int lines, int pageNumber) throws java.rmi.RemoteException{
    if (data == null)
      _initDataProxy();
    return data.queryUserDatas(keyId, productId, userId, lines, pageNumber);
  }
  
  public com.sogou.qadev.service.login.bean.Data[] queryGroupDatas(long keyId, long productId, long groupId, int lines, int pageNumber) throws java.rmi.RemoteException{
    if (data == null)
      _initDataProxy();
    return data.queryGroupDatas(keyId, productId, groupId, lines, pageNumber);
  }
  
  
}